There's no refspec on FCOS now using containers.
We never needed a refspec for any of these, just the commit.
query=$1
rpm-ostree status --json | jq -r "${query}"
}
-host_refspec=$(rpmostree_query_json '.deployments[0].origin')
host_commit=$(rpmostree_query_json '.deployments[0].checksum')
host_osname=$(rpmostree_query_json '.deployments[0].osname')
mkdir -p rootfs/usr/lib/modules/`uname -r`
cp /usr/lib/modules/`uname -r`/vmlinuz rootfs/usr/lib/modules/`uname -r`
dd if=/dev/urandom of=rootfs/usr/lib/modules/`uname -r`/vmlinuz count=1 conv=notrunc status=none
-ostree commit --base "${host_refspec}" -P --tree=dir=rootfs -b modkernel1
+ostree commit --base "${host_commit}" -P --tree=dir=rootfs -b modkernel1
dd if=/dev/urandom of=rootfs/usr/lib/modules/`uname -r`/vmlinuz count=1 conv=notrunc status=none
-ostree commit --base "${host_refspec}" -P --tree=dir=rootfs -b modkernel2
+ostree commit --base "${host_commit}" -P --tree=dir=rootfs -b modkernel2
assert_bootfs_has_n_bootcsum_dirs() {
local expected=$1; shift
prepare_tmpdir
mkdir -p rootfs/var/testcontent
-ostree commit -b testlint --no-bindings --selinux-policy-from-base --tree=ref="${host_refspec}" --consume --tree=dir=rootfs
+ostree commit -b testlint --no-bindings --selinux-policy-from-base --tree=ref="${host_commit}" --consume --tree=dir=rootfs
ostree admin deploy testlint 2>err.txt
assert_not_file_has_content err.txt 'Deploying commit.*which contains content in /var/testcontent'
test '!' -d /var/testcontent
rm co -rf
rm co-testref -rf
ostree refs --delete testref
-ostree checkout -H ${host_refspec} co
+ostree checkout -H ${host_commit} co
victim_symlink=/usr/bin/gtar # Seems likely to stick around
# Copy the link to avoid corrupting it
cp co/${victim_symlink}{,.tmp}
ostree fsck
ostree ls -X testref ${victim_symlink} > ls.txt
assert_file_has_content ls.txt 'security\.biometric'
-ostree ls -X ${host_refspec} ${victim_symlink} > ls.txt
+ostree ls -X ${host_commit} ${victim_symlink} > ls.txt
assert_not_file_has_content ls.txt 'security\.biometric'
ostree ls -X testref usr/bin > ls.txt
assert_file_has_content ls.txt 'security\.crunchy'
date
# Create a new deployment
-ostree admin deploy --karg-proc-cmdline ${host_refspec}
+ostree admin deploy --karg-proc-cmdline ${host_commit}
new_deployment_path=/ostree/deploy/${host_osname}/deploy/${host_commit}.1
# Test /etc directory mtime
date
cd /ostree/repo/tmp
rm co -rf
-ostree checkout -H ${host_refspec} co
+ostree checkout -H ${host_commit} co
testbin=co/usr/bin/foo-a-generic-binary
assert_not_has_file "${testbin}"
# Make a test binary that we label as shell_exec_t on disk, but should be
rm co -rf
echo "ok commit with sepolicy"
-ostree ls -X ${host_refspec} /usr/etc/sysctl.conf > ls.txt
+ostree ls -X ${host_commit} /usr/etc/sysctl.conf > ls.txt
if grep -qF ':etc_t:' ls.txt; then
- ostree checkout -H ${host_refspec} co
+ ostree checkout -H ${host_commit} co
ostree commit -b testbranch --link-checkout-speedup \
--selinux-policy co --tree=dir=co --selinux-labeling-epoch=1
ostree ls -X testbranch /usr/etc/sysctl.conf > ls.txt
rm rootfs -rf
if ostree checkout -H \
- --selinux-policy / ${host_refspec} co; then
+ --selinux-policy / ${host_commit} co; then
assert_not_reached "checked out with -H and --selinux-policy"
fi
# recommit just two binaries into a new branch with selinux labels stripped
rm -f lsz.txt
echo 'somelib' > usr/lib/somelib.so
echo 'someconf' > usr/etc/some.conf
-ostree commit -b newbase --selinux-policy-from-base --tree=ref=${host_refspec} --tree=dir=$(pwd)
+ostree commit -b newbase --selinux-policy-from-base --tree=ref=${host_commit} --tree=dir=$(pwd)
ostree ls -X newbase /usr/bin/somebinary > newls.txt
assert_file_has_content newls.txt ':bin_t:'
ostree ls -X newbase /usr/lib/somelib.so > newls.txt
"")
create_initrd_with_dracut_karg ostree.test1
# let's use the deploy API first
- ostree admin deploy "${host_refspec}" \
+ ostree admin deploy "${host_commit}" \
--overlay-initrd /var/tmp/ostree.test1.img
/tmp/autopkgtest-reboot "2"
;;
create_initrd_with_dracut_karg ostree.test2
# let's use the staging API this time
- ostree admin deploy "${host_refspec}" --stage \
+ ostree admin deploy "${host_commit}" --stage \
--overlay-initrd /var/tmp/ostree.test2.img
/tmp/autopkgtest-reboot "3"
;;
test -f "/boot/ostree/initramfs-overlays/${test2_sha}.img"
# OK, now let's deploy an identical copy of this test
- ostree admin deploy "${host_refspec}" \
+ ostree admin deploy "${host_commit}" \
--overlay-initrd /var/tmp/ostree.test2.img
# Now the deployment with ostree.test1 should've been GC'ed; check that its
# deploy again to check that no bootconfig swap was needed; this verifies
# that deployment overlay initrds can be successfully compared
- ostree admin deploy "${host_refspec}" \
+ ostree admin deploy "${host_commit}" \
--overlay-initrd /var/tmp/ostree.test2.img |& tee /tmp/out.txt
assert_file_has_content /tmp/out.txt 'bootconfig swap: no'
# finally, let's check that we can overlay multiple initrds
- ostree admin deploy "${host_refspec}" --stage \
+ ostree admin deploy "${host_commit}" --stage \
--overlay-initrd /var/tmp/ostree.test1.img \
--overlay-initrd /var/tmp/ostree.test2.img
/tmp/autopkgtest-reboot "4"
mkdir repo
ostree --repo=repo init --mode=archive
echo -e '[archive]\nzlib-level=1\n' >> repo/config
-host_nonremoteref=$(echo ${host_refspec} | sed 's,[^:]*:,,')
+host_nonremoteref=testref
log_timestamps() {
date
"$@"